Trying to debug a 'Assertion failure in -[UIActionSheet showInView:]' error....
Posted
by dsobol
on Stack Overflow
See other posts from Stack Overflow
or by dsobol
Published on 2010-06-01T02:58:50Z
Indexed on
2010/06/01
3:03 UTC
Read the original article
Hit count: 436
objective-c
|ipad-sdk
I am working through "Beginning iPad Application Development" and am getting hung up in Chapter 3 where I have created a project that works with an Action Sheet.
As it stands now, my application loads into the simulator just fine with no errors that I am aware of, but as it runs, it crashes with the following errors showing up in the debugger window:
2010-05-31 19:44:39.703 UsingViewsActionSheet[49538:207] * Assertion failure in -[UIActionSheet showInView:], /SourceCache/UIKit_Sim/UIKit-1145.66/UIAlert.m:7073
2010-05-31 19:44:39.705 UsingViewsActionSheet[49538:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: view != nil'
I am sure that this is the block where the app breaks based upon my use of breakpoints.
//Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
UIActionSheet *action = [[UIActionSheet alloc]
initWithTitle:@"This is my Action Sheet!"
delegate:self
cancelButtonTitle:@"OK"
destructiveButtonTitle:@"Delete Message!"
otherButtonTitles:@"Option 1", @"Option 2", @"Option 3", nil];
[action showInView:self.view]; // <-- This line seems to trigger the crash....
[action release];
[super viewDidLoad];
}
Am I missing something obvious, or is there more to the problem than is shown here? I have looked at the abstract for showInView and cannot divine anything there yet.
I appreciate any and all asssitance.
Regards,
Steve O'Sullivan
© Stack Overflow or respective owner